//
//  DeductionRecordIndexViewController.m
//  ELife
//
//  Created by  刘奇男 on 11-5-17.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import "DeductionRecordIndexViewController.h"
#import "AccountDetailCellViewController.h"

@implementation DeductionRecordIndexViewController

@synthesize tableView, labelBalance;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)dealloc
{
    [super dealloc];
    [tableView release];
    [labelBalance release];
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

/*
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView
{
}
*/


// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad
{
    [super viewDidLoad];
    
    [tableView setDataSource:self];
    [tableView setDelegate:self];
    
    [self.navigationItem setTitle:@"抵扣券明细"]; 
}


- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
	return 10;
}

- (UITableViewCell *)tableView:(UITableView *)table cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
	static NSString *kCellIdentifier = @"DeductionRecordIndexCell";
    
    AccountDetailCellViewController *cell;	
	cell = (AccountDetailCellViewController *)[table dequeueReusableCellWithIdentifier:kCellIdentifier];
    
	if (cell == nil)
	{
        NSArray *nib = [[NSBundle mainBundle]
                        loadNibNamed:@"AccountDetailCellView" owner:self options:nil];
        cell = [nib objectAtIndex:0];
    }
    
	// get the view controller's info dictionary based on the indexPath's row
    
    [cell.label setTextColor:[UIColor redColor]];
	cell.label.text = @"123123123123sdfsdf";
	return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    
}

@end
